import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.wb.swt.SWTResourceManager;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.widgets.Canvas;


// TODO: Auto-generated Javadoc
/**
 * The Class AppointmentRequest.
 */
public class AppointmentRequest {

	/** The shell. */
	protected Shell shell;
	
	/** The text. */
	private Text text;
	
	/** The text_1. */
	private Text text_1;
	
	/** The text_2. */
	private Text text_2;
	
	/** The text_3. */
	private Text text_3;

	/**
	 * Launch the application.
	 *
	 * @param args the arguments
	 */
	public static void main(String[] args) {
		try {
			AppointmentRequest window = new AppointmentRequest();
			window.open();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Open the window.
	 */
	public void open() {
		Display display = Display.getDefault();
		createContents();
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

	/**
	 * Create contents of the window.
	 */
	protected void createContents() {
		shell = new Shell();
		shell.setSize(700, 500);
		shell.setText("SWT Application");
		
		text = new Text(shell, SWT.BORDER);
		text.setBounds(214, 104, 167, 19);
		
		Label lblDate = new Label(shell, SWT.NONE);
		lblDate.setBounds(149, 104, 59, 14);
		lblDate.setText("Date");
		
		text_1 = new Text(shell, SWT.BORDER);
		text_1.setBounds(214, 144, 167, 19);
		
		Label lblTime = new Label(shell, SWT.NONE);
		lblTime.setText("Time");
		lblTime.setBounds(149, 144, 59, 14);
		
		Label lblDoctor = new Label(shell, SWT.NONE);
		lblDoctor.setText("Doctor");
		lblDoctor.setBounds(149, 188, 59, 14);
		
		text_2 = new Text(shell, SWT.BORDER);
		text_2.setBounds(214, 188, 167, 19);
		
		text_3 = new Text(shell, SWT.BORDER);
		text_3.setBounds(214, 230, 322, 104);
		
		Label lblReason = new Label(shell, SWT.NONE);
		lblReason.setText("Reason");
		lblReason.setBounds(149, 265, 59, 14);
		
		Button btnBack = new Button(shell, SWT.NONE);
		btnBack.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseUp(MouseEvent e) {
				Object window;
				shell.close();
				window = new Trainer();
				((Trainer)window).open();
			}
		});
		btnBack.setBounds(222, 405, 94, 30);
		btnBack.setText("Back");
		
		Button btnSubmit = new Button(shell, SWT.NONE);
		btnSubmit.setText("Submit");
		btnSubmit.setBounds(364, 405, 94, 30);
		
		//adding background
		final Display display = Display.getDefault();
		Canvas canvas = new Canvas(shell, SWT.NONE);
		canvas.addPaintListener(new PaintListener() {
			public void paintControl(PaintEvent arg0) {
					 org.eclipse.swt.graphics.Image image = new org.eclipse.swt.graphics.Image(display, "/Users/kennyha/Desktop/Eclipse Workplace/pokemonBackground.png");
					 arg0.gc.drawImage(image, 10, 10);

				        image.dispose();
				
			}
		});
		canvas.setBounds(-14, -22, 714, 500);
		
		Label lblRequestAppointment = new Label(canvas, SWT.NONE);
		lblRequestAppointment.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblRequestAppointment.setBounds(182, 33, 322, 39);
		lblRequestAppointment.setFont(SWTResourceManager.getFont("Lucida Grande", 25, SWT.BOLD));
		lblRequestAppointment.setText("Request Appointment");
		

	}
}
